package C;

import java.util.Arrays;
import java.util.Scanner;

public class C34 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s =  sc.nextLine();
        System.out.println(getResult(s));
    }

    public static int getResult(String line) {
        int[] nums = Arrays.stream(line.split(" ")).mapToInt(Integer::parseInt).toArray();
        int ans = Arrays.stream(nums).max().orElse(0);
        int left = 1,right = ans,mid = 0;
        ans = -1;
        if (nums.length>8) return ans;
        while(left<=right) {
            int sum = 0;
            mid = (left+right)/2;
            if(check(nums,mid)) {
                right = mid-1;
                ans = mid;
            } else {
                left = mid+1;
            }
//            System.out.println("ans="+ans);
        }
        return ans;
//        return -1;
    }

    public static boolean check(int[] nums,int mid) {
        int sum = 0;
        System.out.println("mid="+mid);
        for (int num:nums) {
            System.out.print("num="+(int)Math.ceil(num/mid)+" ");
            sum+=(int)Math.ceil((double)num/mid);
            if (sum>8) return false;
        }
        System.out.println("sum="+sum);
        return true;
    }
}
